package com.yl.module.user.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Todo
 * @Author jiangtao
 * @CreateBy 2020-05-06 2:12 PM
 * @UpdateBy jiangtao
 * @Version v1.0
 */
@Slf4j
@Controller
public class RegisterController {

    @Autowired
    private ApplicationContext applicationContext;
    //@Autowired
    //private ApplicationEventPublisher eventPublisher;


    /**
     * //注册
     *
     * @param req
     * @param resp
     * @return
     * @throws Exception
     */
    @RequestMapping("register/done")
    public String register(@RequestParam(value = "fileUpload1", required = false) MultipartFile file,
                           HttpServletRequest req, HttpServletResponse resp) throws Exception {

        /*
        User user = new User();
        if (userService.save(user)) {
            applicationContext.publishEvent(new UserRegisterEvent(this, user));
            eventPublisher.publishEvent(new UserRegisterEvent(this, user));
        } else {

        }*/
        return null;
    }
}
